<template>
  <div id="app">
    <div v-if="loadRouterView">
      <router-view />
    </div>
  </div>
</template>


<script>
export default {
  data() {
    return {
      // 获取到路由信息并且执行完addRoutes之后才能显示此页面的router-view
      loadRouterView: false,
    };
  },
  created() {
    this.gGet("/menu/getrouter", {}).then((res) => {
      let routes = this.handleRouterTree(res.data);
      this.$router.addRoutes(routes);
      this.loadRouterView = true;
    });
  },
};
</script>

<style>
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
}
</style>
